package com.sg.business.commons.operation.handler.vault;

import com.mongodb.DBObject;
import com.sg.business.model.Document;
import com.sg.widgets.MessageUtil;
import com.sg.widgets.part.CurrentAccountContext;

public class ModifyDocumentPhase extends AbstractOpenDocumentHandler {

	@Override
	protected void updateDocumentWithData(Document document, DBObject data)
			throws Exception {
		try {
			String phase = (String) data.get(Document.F_PHASE);
			document.doModifyPhase(new CurrentAccountContext(),
					phase);
		} catch (Exception e) {
			MessageUtil.showToast(e);
		}
	}

	@Override
	protected String getEditorId() {
		return "vault.document.phase";
	}

}
